data<-read.table("merge_expr_BRCA_expr_tumor",sep="\t",head=T)
snp<-read.table("selected_samples_genotypes_genes")
samp<-as.vector(as.character(snp[,1]))
i<-1
array<-c()
while(i<length(samp)+1)
{
        #array[i]<-paste(unlist(strsplit(samp[i],"-"))[1],unlist(strsplit(samp[i],"-"))[2],unlist(strsplit(samp[i],"-"))[3],sep="-")
        array[i]<- gsub("-","\\.",samp[i])
        i<-i+1
}
array<-c("geneid",array)
data1<-data[,array]
write.table(data1,"GE.txt",sep="\t",col.names=T,row.names=F,quote=F)
